{% extends "home/base.html" %}

{% block content %}
<div id="items">
	{% for item in posts.object_list %}
    <div class="item" data-id="{{ item.id }}">
        <a href="{{ item.link }}" target='_blank' title="{{ item.name }}" target="_self" class="img">
            <img class='lazy' data-original='{{ item.link_img }}'>
        </a>
        <div class="attribution">
            <div class="title">
                <p>{{ item.name }}</p>
            </div>
            <div class="catalog">
                <p>
                    <span>{{ item.catalog.name }}</span>
                    {% for tag in item.tags.all %}
                        <span>{{ tag.name }}</span>
                    {% endfor %}
                </p>
            </div>
            <div class="price">
                <p>
                    <span class="price-tag">￥{{ item.price }}元</span>
                    <span class="price-tag old">￥{{ item.price_old }}元</span>
                    <span>月销量:{{ item.sale_count }}</span>
                </p>
            </div>
            <ul class="tags">
                <li>
                    <a href="{{ item.link }}" class="btn-buy" target="_blank">
                        <span class="text">购买</span>
                    </a>
                </li>
                <li>
                    <a title="喜欢" href="javascript:;" class="btn btn-like">
                        <i class="heart"></i>
                        <span class="text">{{ item.liked }}</span>
                    </a>
                    <!-- <a title="评论" href="javascript:;" class="btn btn-comment">
                        <i class="heart"></i>
                        <span class="text">0</span>
                    </a> -->
                </li>
                
            </ul>
            <div class="comments">
                <div class="comments-items"></div>
            </div>
        </div>
    </div>
    {% endfor %}
</div>
{% endblock %}